Lecture 1

Introduction

Sara Martino

Dept. of Mathematical Science, NTNU

Introduction

What is INLA? What is inlabru?

The short answer:

INLA is a fast method to do Bayesian inference with latent Gaussian models and inlabru is an R-package that implements this method with a flexible and simple interface.

The (much) longer answer:

cite some papers here

Where?

The software, information, examples and help can be found at

cite github for inlabru

  • paper
  • tutorials
  • discussion group

So… Why should you use inlabru?

  • What type of problems can we solve?
  • What type of models can we use?
  • When can we use it?

So… Why should you use inlabru?

  • What type of problems can we solve?
  • What type of models can we use?
  • When can we use it?

To give proper answers to these questions, we need to start at the very beginning ..

The core

  • We have observed something.

The core

  • We have observed something.
  • We have questions.

The core

  • We have observed something.
  • We have questions.
  • We want answers!

How do we find answers?

We need to make choices:

  • Bayesian or frequentist?
  • How do we model the data?
  • How do we compute the answer?

How do we find answers?

We need to make choices:

  • Bayesian or frequentist?
  • How do we model the data?
  • How do we compute the answer?

These questions are not independent.

Bayesian or frequentist?

In this course we embrace the Bayesian perspective

  • There are no “true but unknown” parameters!
  • Every parameter is described by a probability distribution!
  • Evidence from the data is used to update the belief we had before observing the data!

A simple example

Assume a simple linear regression model with Gaussian observations \(y = (y_1 , \ldots, y_n)\), where \[ \text{E}(y_i) = \alpha + \beta x_i, \text{Var}(y_i) = \tau^{-1}, \quad i=1,\ldots, n \]

Topics of this lecture

  • Why Bayesian statistics
  • What Latent Gaussian Models (LGMs) are and why are they useful
  • What are model components
  • How to fit simple models with inlabru

The inlabru workflow

# Define model components
comps <- component_1(...) + component_2(...) + ...

# Define the model predictor
pred <- non_linear_function(component_1, component_2, ...)

# Build the observation model
lik <- bru_obs(components = comps,
            formula = pred,
            ...)

# Fit the model
fit <- bru(comps, lik, ...)

Bayesian Statistics

Latent Gaussian Models

What is a LGM?

A simple linear model

\[ \begin{aligned} y_i|\eta_i & \sim\mathcal{N}(\mu_i, \sigma^2), \qquad i = 1\dots,N\\ \eta_i & = \mu_i = \beta_0 + \beta_1x_i\\ \beta_0,\beta_1&\sim\mathcal{N}(0,\tau) \end{aligned} \] Is this a LGM?